{% extends 'core/panels/bugs.html' %}
{% load distro_tracker_extras %}

{# Add the bug history graph to the panel's heading #}
{% block panel-header %}
{{ block.super }}
<a class="m-l-1" href="{{ panel.context.graph_url }}">{% octicon 'graph' 'bug history graph' %}</a>
{% endblock %}

{% block bugs-list %}
    {% for category in panel.context.categories %}
    <li class="list-group-item">
        <span class="list-item-key">
            {% if category.link %}
            <a href="{{ category.link }}">
            {% endif %}
            <b><span title="{{ category.description }}">{{ category.display_name }}:</span></b>
            {% if category.link %}
            </a>
            {% endif %}
        </span>
        <a class="label label-primary label-pill pull-xs-right m-l-1"
	title="Number of bugs" href="{{ category.url }}">{{ category.bug_count }}</a>
	{# Add merged bug count if it was given #}
	{% if category.merged %}
	<a class="label label-default label-pill pull-xs-right" title="Number of bugs, including all merged bugs" href="{{ category.merged.url }}">{{ category.merged.bug_count }}</a>
        {% endif %}
    </li>
    {% endfor %}
{% endblock %}
